package com.haima.sage.bigdata.api.frame.datatype.impl;

import com.haima.sage.bigdata.api.frame.datatype.DataTypeService;

public class CharDataTypeService extends DataTypeService<Character> {

    @Override
    public Character trans(Object value) {
        if (null == value) {
            return null;
        }
        if (value instanceof Character) {
            return (Character) value;
        }
        String dist = value.toString().trim();
        if (dist.length() > 0) {
            return dist.charAt(0);
        }
        return null;
    }

}
